'use strict';

module.exports = app => {
  const {TEXT, STRING, INTEGER, DATE } = app.Sequelize;

  const Feedback = app.model.define('feedback', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    user_id: {
      type: INTEGER(64),
      allowNull: true,
      comment: '用户id',
    },
    content:{
      type: TEXT,
      allowNull: true,
      comment: '反馈描述',
    },
    mobile: {
      type: STRING(255),
      allowNull: true,
      comment: '手机号',
    },
    imgs: {
      type: TEXT,
      allowNull: true,
      comment: '反馈图片',
    },
    created_at: DATE,
    updated_at: DATE,
  }, {
    sequelize:app.Sequelize,
    modelName: 'feedback',
    tableName: 'feedback',
    freezeTableName: true
  });

  return Feedback;
};